package cn.iocoder.yudao.module.ent.dal.mysql.receivedata;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.ent.controller.admin.receivedata.vo.ReceiveDataPageReqVO;
import cn.iocoder.yudao.module.ent.dal.dataobject.receivedata.ReceiveDataDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 领取列表 Mapper
 *
 * @author PetePower
 */
@Mapper
public interface ReceiveDataMapper extends BaseMapperX<ReceiveDataDO> {

    default PageResult<ReceiveDataDO> selectPage(ReceiveDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReceiveDataDO>()
                .likeIfPresent(ReceiveDataDO::getEntName, reqVO.getEntName())
                .eqIfPresent(ReceiveDataDO::getFollowStatus, reqVO.getFollowStatus())
                .eqIfPresent(ReceiveDataDO::getOwnerUserId, reqVO.getOwnerUserId())
                .eqIfPresent(ReceiveDataDO::getLastFollowRecord, reqVO.getLastFollowRecord())
                .betweenIfPresent(ReceiveDataDO::getLastFollowTime, reqVO.getLastFollowTime())
                .eqIfPresent(ReceiveDataDO::getLastFollowType, reqVO.getLastFollowType())
                .eqIfPresent(ReceiveDataDO::getTags, reqVO.getTags())
                .betweenIfPresent(ReceiveDataDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ReceiveDataDO::getId));
    }

}